rm(list = ls())
### Specify working directory path here
### Make sure working directory path points to the replication folder
# path = ""
# setwd(path)
# # Install necessary packages manuall, if necessary:
# install.packages("devtools")
# library(devtools)
# install_version("dplyr", version = "1.1.4", dependencies = F)
# install_version("haven", version = "2.5.4")
# install_version("foreign", version = "0.8-87")
# install_version("lmtest", version = "0.9-40")
# install_version("sandwich", version = "3.1-0")
# install_version("stargazer", version = "5.2.3")
# install_version("sjmisc", version = "2.8.10")
# install_version("ggplot2", version = "3.5.1")
# install_version("reshape2", version = "1.4.4")
# install_version("xtable", version = "1.8-4")
# install_version("tidyr", version = "1.3.1")
# install_version("estimatr", version = "1.0.4")
# install_version("ineq", version = "0.2-13")
# install_version("multcomp", version = "1.4-25")
# install_version("broom", version = "1.0.6")
# install_version("texreg", version = "1.39.3")
# install_version("Matching", version = "4.10-15")
# install_version("ggpubr", version = "0.6.0")
# install_version("sf", version = "1.0-16")
# install_version("stringr", version = "1.5.1")
# install_version("lfe", version = "3.0-0")
# install_version("lme4", version = "1.1-35.3")
# install_version("RColorBrewer", version = "1.1-3")
#
# Check read permission: returns 0 if accessible, -1 otherwise
file.access("renv.lock", 4)
# Check write permission: returns 0 if accessible, -1 otherwise
file.access("renv.lock", 2)
install.packages("renv")  # if not installed
renv::activate()
renv::restore()
renv::restore()
